<script type="text/javascript" src="<?php echo $this->Html->url('/js/countdown.js');?>"></script>

<?php
//debug($part);
   
    echo $this->Form->create('test',array('url'=>'/users/test_submit','method'=>'post','name'=>'testForm'));
    echo $this->Form->input('part_id',array('type'=>'hidden','value'=>$part['Part']['id']));
    ?>
    <input type="hidden" id="expire_url" value="<?php echo $this->Html->url("/users/test_submit/timeExpired");?>" />
    <h2 class="question"><?php echo $part['Part']['name'];?></h2>
    <div align="right">Time Remaining<span id="timer"></span></div>
    
    <?php 
        if($part['Part']['type']=='options') {
    ?>
    
    
    
    <?php 
        foreach($part['Question'] as $question) {
        $radios = explode(',',$question['options']);
        $radios = array_combine($radios,$radios);
    ?>
        <p><?=$question['question']?></p>
        <p>                         
           <?php echo $this->Form->input('question['.$question['id'].']',array('name'=>'question['.$question['id'].']','type'=>'radio','options'=>$radios,'legend'=>false));?>
        </p>
    <?php } ?>
    
<?php
    }
    else {
        
         echo $this->Form->input('question['.$part['Question'][0]['id'].']',array('name'=>'question['.$part['Question'][0]['id'].']','type'=>'textarea','legend'=>false,'label'=>''));
    }
    echo $this->Form->end('Next');
?>
<script>
	init(<?php echo isset($diff['diff_2'])?$diff['diff_2']:$diff['diff_1']?>);
</script>